#include <stdio.h>
#include <stdlib.h>
typedef struct BSTNode
{
	int data;
	struct BSTNode* left;
	struct BSTNode* right;
}BSTNode;
BSTNode* root = NULL;
int IsSubtreeGreater(BSTNode* root,int data)
{
	if(root==NULL) return 1;
	if(root->data>data
	&&IsSubtreeGreater(root->left,data)
	&&IsSubtreeGreater(root->right,data))
	return 1;
	else
	return 0;
}
int IsSubtreeLesser(BSTNode* root,int data)
{
	if(root==NULL) return 1;
	if(root->data<=data
	&&IsSubtreeLesser(root->left,data)
	&&IsSubtreeLesser(root->right,data))
	return 1;
	else
	return 0;
}
int IsBinarySearchTree(BSTNode* root)
{
	if(root==NULL) return 1;
	if(IsSubtreeLesser(root->left,root->data)
	&&IsSubtreeGreater(root->right,root->data)
	&&IsBinarySearchTree(root->left)
	&&IsBinarySearchTree(root->right))
	return 1;
	else
	return 0;
}
int main(void)
{
	
}
